package day02;
import java.sql.Connection;
import java.sql.Statement;
import day01.DBUtil;
import day01.DBUtil2;
/**
 * 删除记录
 */
public class JDBCDemo3 {
	public static void main(String[] args) {
		try{
			Connection conn=DBUtil2.getConnection();
			Statement state=conn.createStatement();
			/*
			 * DELETE emp WHERE empno=8000
			 */
			String sql="DELETE FROM emp WHERE empno=8000";
			System.out.println(sql);
			int flag=state.executeUpdate(sql);
			if(flag>0){
				System.out.println("删除成功");
			}else{
				System.out.println("删除失败");
			}
			state.close();
			DBUtil.closeConnection();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
